package com.attendance.www.hr.controller;

import java.text.SimpleDateFormat;
import java.util.Date;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.attendance.www.hr.service.IMainService;
import com.attendance.www.hr.service.IRequestInterfaceTaskService;
import com.zhangkongli.frame.core.ResultMap;

/**
 * 
 * @author 主数据对接
 *
 */
@Controller
@RequestMapping("/main")
public class MainController {

	@Resource
	private IMainService mainService;
	@Resource
	private IRequestInterfaceTaskService requestInterfaceTaskService;

	/**
	 * 获取主数据全量接口
	 * 
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/requestMaindata.do", method = { RequestMethod.POST, RequestMethod.GET })
	@ResponseBody
	public Object requestMaindata(HttpServletRequest request) {
		mainService.requestMaindata();
		return ResultMap.success();
	}

	/**
	 * 获取主数据增量接口
	 * 
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/requestMaindataNew.do", method = { RequestMethod.POST, RequestMethod.GET })
	@ResponseBody
	public Object requestMaindataNew(HttpServletRequest request) {
		mainService.requestMaindataNew();
		return ResultMap.success();
	}

}
